/**
 * Created by losor on 2017/3/8.
 */
public class _268_MissingNumber {
    public int missingNumber(int[] nums) {
        int sum = 0;
        for (int i = 0; i < nums.length; i++) {
            sum += nums[i];
        }
        return (nums.length*nums.length + nums.length)/2 - sum;
    }


}
